package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class HelloController {

    @RequestMapping("/hello")
    @PostMapping
    @GetMapping
    public String hello(Model model,@RequestParam String gender) {

        model.addAttribute("name", gender);
        return "redirect:1hello";

        //return "hello";


    }
    @RequestMapping("h2")
    public String hello2(){
        return "hello";
    }
}